import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.webapp.WebAppContext;

/**
 * Created by Johnny(johnny@hejiajinrong.com) on 14-8-28.
 */

public class Main {

    public static void main(String[] args) throws Exception {
        int port = 9001;
        
        Server server = new Server(port);
        QueuedThreadPool threadPool = new QueuedThreadPool();
        threadPool.setMaxThreads(100);

        System.setProperty("org.eclipse.jetty.util.URI.charset", "UTF-8");

        WebAppContext context = new WebAppContext();
        context.setContextPath("/");
        context.setResourceBase("src/main/webapp");

        HandlerList handlers = new HandlerList();
        handlers.setHandlers(new Handler[] { context });
        server.setHandler(handlers);

        server.start();
        server.join();
    }

}
